import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
/*基础css*/
import './assets/css/base.css'

/*element-ui*/
import ElementUi from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUi);

/*axios*/
import axios from "axios";

axios.defaults.baseURL = 'http://localhost:8888/api/'
axios.interceptors.request.use(config => {
    /*每次请求携带token*/
    const token = 'Bearer ' + window.sessionStorage.getItem("token")
    config.headers.Authorization = token
    return config
})
Vue.prototype.$axios = axios;


/*时间格式化*/
import moment from 'moment'
//全局过滤器格式化日期
Vue.filter('fmtdate', v => {
    return moment(v).format('yyyy-MM-DD')
})


Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
